package com.gome.oa.listener;

import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;

import com.teamdev.jexplorer.event.StatusAdapter;

/**
 *
 * @author: tang li
 * @date: 2016年8月13日
 * @desc: 
 *
 */
public class BrowserStatusListener extends StatusAdapter {
	
	private Object titleBar;
	
	private JLabel statusBar;
	
	public BrowserStatusListener(Object titleBar, JLabel statusBar) {
		super();
		this.titleBar = titleBar;
		this.statusBar = statusBar;
	}

	public void statusTextChanged(String text) {
		statusBar.setText(text);
	}
	
	public void titleChanged(String title) {
		if(titleBar instanceof JDialog) {
			((JDialog)titleBar).setTitle(title);
		}
		else if(titleBar instanceof JFrame) {
			((JFrame)titleBar).setTitle(title);
		}
	}
}
